<script>
	import user from '@/api/user.js';
	export default {
		onShow({ query }) {
			console.log(query,'分享参数')
			let user = uni.getStorageSync('userInfo')
			if(!query.userid) return	//拦截没有分享参数
			if(!user.id) return			//拦截未登录
			if(query.userid == user.id) return	//拦截相同userid
			memberShare({
				id: query.userid
			})
		},
		methods: {
			async memberShare(query){
				const res = await user.member_share(query)
				if(res.code === 200) {
					uni.showToast({
						title: '绑定成功',
						icon: 'none'
					})
				}else {
					uni.showToast({
						title: res.msg,
						icon: 'none'
					})
				}
			}
		}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	@import "./uni_modules/vk-uview-ui/index.scss";
	@import "./static/css/style.scss";
	
	@import url("/static/icons/iconfont.css");
	@import url("/static/icons/iconfont-weapp.css");
	/* 去除默认滚动条效果 */
	::-webkit-scrollbar {	
		display: none;
		width: 0;
		height: 0;
		color: transparent;
	}
</style>
